package net.kong.sns.rest.client.model;

/**
 * @author <a href="mailto:lanhuai@gmail.com">Ning Yubin</a>
 * @version $Id: PayRegOrderResponse.java,v 1.2 2009/11/02 08:21:22 ningyubin Exp $
 */
public interface PayRegOrderResponse extends BaseObject{
    String getToken();
    String getCode();
    public static enum Field {
        TOKEN, CODE;

        @Override
        public String toString() {
            return name().toLowerCase();
        }
    }

    public static enum PayType {
        K_GOLD(1);

        PayType(int code) {
            this.code = code;
        }

        private int code;

        /**
         * 返回类型整数常量
         * @return int
         */
        public int getCode() {
            return code;
        }

        public static PayType valueOf(int code) {
            for (PayType payType : PayType.values()) {
                if (payType.getCode() == code) {
                    return payType;
                }
            }
            return null;
        }
    }
}
